<div class="row">
  <div class="col-xs-12 col-sm-offset-4 col-sm-4">

    <% if @user.persisted? %>

        已经绑定 <%= @user.email %>
        <%= link_to '直接登陆', account_login_by_wechat_path(oid: @user.wechat_openid), class: 'btn btn-primary' %>

    <% else %>
        <%= form_for(@user, url: account_do_bind_path) do |f| %>
            <%= f.hidden_field :wechat_openid %>
            <div>
              <%= f.label :email %>
              <%= f.email_field :email, class: 'form-control' %>
            </div>

            <div>
              <%= f.label :password %>
              <%= f.password_field :password, class: 'form-control' %>
            </div>

            <div class="m-t-10">
              <%= f.submit '登录绑定账户', class: 'btn btn-primary' %>
            </div>
        <% end %>
    <% end %>
  </div>
</div>
